package chapter04;

import java.util.Arrays;

public class Java07_Object_Method_Param_01 {
    public static void main(String[] args) {
        int i = 10;
        test(i);
        // Java传值中基本数据类型传的是值
        System.out.println(i);

        System.out.println("---------");

        String s = "abc";
        test1(s);
        System.out.println(s);

        System.out.println("---------");

        User user = new User();
        // Java传值中引用数据类型传的是引用地址
        user.name = "zhangsan";
        test2(user);
        System.out.println(user.name);
    }

    public static void test(int i) {
        i = i + 10;
    }

    public static void test1(String s) {
        s = s + 10;
    }

    public static void test2(User user) {
        user.name = "lisi";
    }
}
class User{
    String name;
}

